<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>后台管理系统-二级分类</title>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="assets/nprogress/nprogress.css"/>
    <link rel="stylesheet" href="css/admin.css"/>
    <style>
        [name="pic1"]{
            width: 82px;
            height: 34px;
            overflow: hidden;
            display: block;
            opacity:0;
            position: absolute;
            left: 0;
            top:0
        }
    </style>
</head>
<body>
<!--侧边栏-->
<aside class="ad_aside">
    <!--商标-->
    <div class="brand"><a href="index.html">ITCAST</a></div>
    <!--用户-->
    <div class="user">
        <img src="images/default.png" alt=""/>
        <span>超级管理员</span>
    </div>
    <!--菜单-->
    <div class="menu">
        <ul>
            <li><a href="userManage.html"><span class="glyphicon glyphicon-user"></span> 用户管理</a></li>
            <li class="now">
                <a href="javascript:;"><span class="glyphicon glyphicon-list"></span> 分类管理</a>
                <div class="child">
                    <a href="categoryFirst.html">一级分类</a>
                    <a class="now" href="categorySecond.html">二级分类</a>
                </div>
            </li>
            <li><a href="productManage.html"><span class="glyphicon glyphicon-tags"></span> 商品管理</a></li>
        </ul>
    </div>
</aside>
<!--内容-->
<section class="ad_section">
    <!--顶部导航-->
    <nav class="ad_nav">
        <a data-menu href="javascript:;"><span class="glyphicon glyphicon-align-justify"></span></a>
        <a data-logout href="javascript:;"><span class="glyphicon glyphicon-log-out"></span></a>
    </nav>
    <div class="container-fluid">
        <!--路径导航-->
        <ol class="breadcrumb">
            <li><a href="#">管理系统</a></li>
            <li class="active">分类管理</li>
            <li class="active">二级分类</li>
        </ol>
        <div class="ad_content">
            <button data-toggle="modal" data-target="#save" class="btn btn-default mb_15">添加分类</button>
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>一级分类名称</th>
                        <th>二级分类名称（品牌）</th>
                        <th>品牌logo</th>
                    </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
            <nav class="text-right">
                <ul class="pagination">
                   <!--TODO-->
                </ul>
            </nav>
        </div>
    </div>
</section>
<script type="text/template" id="list">
    <% var $ = getJquery(); %>
    <% $.each(rows,function(i,item){ %>
        <tr>
            <th scope="row"><%=i+1+(page-1)*size%></th>
            <td><%=item.categoryName%></td>
            <td><%=item.brandName%></td>
            <td><img width="40" height="40" src="<%=item.brandLogo%>" alt=""></td>
        </tr>
    <% }); %>
</script>
<div class="modal fade" id="save">
    <div class="modal-dialog modal-sm" >
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
                <h4 class="modal-title">添加分类</h4>
            </div>
            <div class="modal-body">
                <form id="form">
                    <div class="form-group">
                        <div>
                            <label>一级分类:</label>
                            <!--下拉菜单-->
                            <div class="dropdown btn-group">
                                <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
                                    <span class="categoryName">请选择</span>
                                    <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <!--TODO-->
                                </ul>
                            </div>
                        </div>
                        <!--序列化表单 获取表单元素的值-->
                        <input type="hidden" name="categoryId">
                    </div>
                    <div class="form-group">
                        <input name="brandName" type="text" class="form-control" placeholder="请输入二级分类名称">
                    </div>
                    <div class="form-group"  style="position: relative">
                        <button class="btn btn-default">上传图片</button>
                        <input type="file" name="pic1">
                        <input type="hidden" name="brandLogo">
                    </div>
                    <img id="uploadImage" src="images/none.png"  width="100" height="100" alt="">
                    <!--校验插件 必须有submit  用form外的submit关联-->
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="submit" form="form" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>
<script type="text/template" id="dropDown">
    <% var $ = getJquery(); %>
    <% $.each(rows,function(i,item){%>
        <li><a data-id="<%=item.id%>" href="javascript:;"><%=item.categoryName%></a></li>
    <% }); %>
</script>
<script src="assets/jquery/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/nprogress/nprogress.js"></script>
<script src="assets/artTemplate/template-native.js"></script>
<script src="assets/bootstrap-paginator/bootstrap-paginator.min.js"></script>
<!--上传插件-->
<script src="assets/jquery-fileupload/jquery.ui.widget.js"></script>
<script src="assets/jquery-fileupload/jquery.fileupload.js"></script>
<!--检验插件-->
<script src="assets/bootstrap-validator/js/bootstrapValidator.min.js"></script>
<script src="js/admin.js"></script>
<script src="js/categorySecond.js"></script>
</body>
</html>